/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cognition.util.marshal;

/**
 *
 * @author richard
 */
public class CharMarshaller {
    public static final int MARSHAL_SIZE = 1;

    public static char unmarshal(byte[] b) throws IllegalArgumentException {
        if (b == null || b.length < MARSHAL_SIZE) {
            throw new IllegalArgumentException(
                    "Cannot unmarshal a byte array that is null or too short.");
        }

        return (char)b[0];

    }

}
